package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.MyTravelList;
import cn.wolfcode.trip.base.mapper.MyTravelListMapper;
import cn.wolfcode.trip.base.service.IMyTravelListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MyTravelListServiceImpl implements IMyTravelListService {

    @Autowired
    private MyTravelListMapper myTravelListMapper;


    @Override
    public void deleteByPrimaryKey(Long id) {
        myTravelListMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void insert(MyTravelList record) {
        myTravelListMapper.insert(record);
    }

    @Override
    public MyTravelList selectByPrimaryKey(Long id) {
        return myTravelListMapper.selectByPrimaryKey(id);
    }


    @Override
    public List<MyTravelList> selectAll() {
        return myTravelListMapper.selectAll();
    }

    @Override
    public void updateByPrimaryKey(MyTravelList record) {
        myTravelListMapper.updateByPrimaryKey(record);
    }

    @Override
    public MyTravelList selectByUserIdAndStrategyId(Long userId, Long strategyId) {
        return myTravelListMapper.selectByUserIdAndStrategyId(userId,strategyId);
    }

    @Override
    public void saveRelation(MyTravelList travelList) {
        myTravelListMapper.insert(travelList);
    }

    @Override
    public List<Map> getByUserId(Long userId) {
        return myTravelListMapper.getByUserId(userId);
    }


}
